<!DOCTYPE html>
<html lang="zh-cmn-Has-ZN">
<head>
    <meta charset="UTF-8">
    <title>dashboard</title>
    <script src="./js/jquery.min.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body>
    <div id="box"></div>
    <div id="rolling">asd</div>
</body>
<script type="application/javascript">
    $("#box").append('<div class="title">微博关键词用户采集器</div>').hide().fadeIn(500);
    setTimeout(function () {
        $.ajax({
            url:"http://localhost:8080/user/count",
            success:function(result){
                $("#box").append('<div class="sub_title">已采集 '+result+' 名微博用户</div>').hide().fadeIn(500);
            }});

    },500);
    setTimeout(function () {
        $("#box").append('<div class="items"></div>');
        $(function () {
            $.ajax({
                url:"http://localhost:8080/keyword/all",
                success:function(result){
                    for(var i = 0 ; i < result.length ; i++){
                        $(".items").append("<div class='item'>"+result[i]+"</div>").hide().fadeIn(500);
                    }
                }});
            $("div").on("click",".item",function () {
                location.href = "./detail.html?key="+encodeURI($(this).text());
            })
        })
    },1000);


</script>
</html>